package com.ambow.core.controller;


import com.ambow.core.dqUtil.RoleUtil;
import com.ambow.core.po.DqUser;
import com.ambow.core.service.DqUserService;
import com.dq.gamepropaganda.common.R;
import io.swagger.annotations.ApiOperation;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author dq
 * @since 2022-09-05
 */
//跨域
@CrossOrigin
@RestController
@RequestMapping("/admin/dqUser")
public class DqUserController {

    @Autowired
    private DqUserService dqUserService;

    //查看user列表

    @GetMapping("/userList")
    @ApiOperation(value = "user列表")
    public R userList(){
        List<DqUser> list = dqUserService.list();
        if (list != null){
            return R.ok().data("list",list);
        }else {
            return R.error();
        }
    }

    //完善
    @PostMapping("/wanShanUser")
    @ApiOperation(value = "完善个人信息")
    public R wanShanUser(DqUser user){

        dqUserService.updateById(user);
        return R.ok();
    }






}

